package com.itfreer.gis.map.configuration;

import javax.servlet.MultipartConfigElement;

import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.itfreer.file.service.kindeditor.KindeditorPara;

/**
 * 文件服务器配置
 */
@Configuration
public class FileConfiguration {

	/**
	 * 文件上传配置
	 * 
	 * @return
	 */
	@SuppressWarnings("deprecation")
	@Bean
	public MultipartConfigElement multipartConfigElement() {
		MultipartConfigFactory factory = new MultipartConfigFactory();
		// 单个数据大小
		factory.setMaxFileSize("10MB");
		/// 总上传数据大小
		factory.setMaxRequestSize("100MB");
		return factory.createMultipartConfig();
	}
	
	/**
	 * kindeditor的附件下载地址前缀
	 * @return
	 */
	@Bean
	public KindeditorPara kindeditorPara() {
		KindeditorPara para = new KindeditorPara();
		return para;
	}
}
